using System;

namespace Webshop20.Domain.Shared.Products.Core
{
    public class SalesTax : ISalesTax
    {
        public virtual int Id
        {
            get;
            set; 
        }

        public virtual DateTime StartDate
        {
            get; private set;

        }

        public virtual DateTime EndDate
        {
            get; private set;
        }

        public virtual int TaxRateInPercent
        {
            get; private set;
        }
    
        public SalesTax()
        {}

        public SalesTax(int taxRateInPercent)
        {
            TaxRateInPercent = taxRateInPercent;
        }

        public virtual decimal Calculate(decimal netPrice)
        {
            return netPrice * TaxRateInPercent / 100;
        }
    }
}